#!/bin/bash
#Author:Neil.Qiao 2016-12-27
#使用方法：pathTO/showdir.sh DIR

recdir ()
{
	pre=$pre$singlepre
	for file in "$@" ; do
		echo -e $pre$verdash$dash$file
		singlepre="|\t"
		verdash="|"
		dash="---"
		thisfile=$thisfile/$file

		if [ -d "$thisfile"  ];then
			recdir $(command ls $thisfile)
		fi

		thisfile=${thisfile%/*}
	done
	pre=${pre%"$singlepre"}
}

recdir $1
